<?php if($model->specialnotes): ?>
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog',array(
    'id'=>'mydialog',
    // additional javascript options for the dialog plugin
    'options'=>array(
        'title'=>'ALERT: Special Notes',
        'autoOpen'=>true,
    ),
));
?>
Global:  <?=$model->specialnotes; ?> <br/>
<?php

$this->endWidget('zii.widgets.jui.CJuiDialog');

?>
<?php endif;?>
<div class="form">
    <script>
    </script>
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'customers-form',
	'enableAjaxValidation'=>false,
        
        'htmlOptions'=>array(
            'enctype'=>'multipart/form-data',
        )
      
    
)); 
/* @var $model Customers */
    $discount=$model->discount;
    $latecharge=$model->latecharge;
    
    if($model->isNewRecord){
        $latecharge=$discount='0.00';
        
    }
?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
    <div class="row">        
        <?php echo $form->labelEx($model,'image'); ?>     
        <?php echo $form->fileField($model,'file');?>
        <?php echo $form->error($model,'file'); ?>
    </div>
   
	<div class="row">
            <?php echo $form->labelEx($model,'custno'); ?>
            <?php echo $form->textField($model,'custno');?>                        
            <?php echo $form->error($model,'custno'); ?>
	</div>
      
	<div class="row">
		<?php echo $form->labelEx($model,'lastname'); ?>
		<?php echo $form->textField($model,'lastname',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'lastname'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'firstname'); ?>
		<?php echo $form->textField($model,'firstname',array('size'=>25,'maxlength'=>25)); ?>
		<?php echo $form->error($model,'firstname'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'add1'); ?>
		<?php echo $form->textField($model,'add1',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'add1'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'add2'); ?>
		<?php echo $form->textField($model,'add2',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'add2'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'city'); ?>
		<?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
                        'model'=>$model,
                        'attribute'=>'city',
                        'sourceUrl'=>'index.php?r=ajax/searchCity',                      
                        'options'=>array(
                            'minLength'=>'2',   
                            'select'=>'js:function(event,ui){ getCityData(ui.item.value) }'
                        ),
                        'htmlOptions'=>array(
                            //'style'=>'height:20px;'
                        ),
                    ));?>
		<?php echo $form->error($model,'city'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'state'); ?>
		<?php echo $form->dropDownList($model,'state',getStateList()); ?>
		<?php echo $form->error($model,'state'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'zip'); ?>
		<?php echo $form->textField($model,'zip',array('size'=>10,'maxlength'=>10)); ?>
		<?php echo $form->error($model,'zip'); ?>
	</div>
        <div class="row">
            <?php echo $form->labelEx($model,'county');?>
            <?php echo $form->textField($model,'county');?>
            <div class="model-data">
                <a href='javascript:void(0)' onclick="searchCountyOnCustomer()">Lookup County</a>
            </div>
            <?php echo $form->error($model,'county');?>
        </div>
        
	

	<div class="row">
		<?php echo $form->labelEx($model,'creditrate'); ?>
		<?php echo $form->textField($model,'creditrate',array('size'=>7,'maxlength'=>7)); ?>
		<?php echo $form->error($model,'creditrate'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'terms'); ?>
		<?php echo $form->dropDownList($model,'terms',$model->termList); ?>
		<?php echo $form->error($model,'terms'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'pricecode'); ?>
		<?php echo $form->dropDownList($model,'pricecode',$model->getPriceCode()); ?>
		<?php echo $form->error($model,'pricecode'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'discount'); ?>
                
		<?php echo $form->textField($model,'discount',array(
                    'value'=>$discount
                )); ?>
		<?php echo $form->error($model,'discount'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'latecharge'); ?>
		<?php echo $form->textField($model,'latecharge',array(
                    'value'=>$latecharge
                )); ?>
		<?php echo $form->error($model,'latecharge'); ?>
	</div>
        
        <?php echo $form->hiddenField($model,'custref',array('size'=>15,'maxlength'=>15)); ?>

	
		<?php echo $form->hiddenField($model,'statement'); ?>
	
	<div class="row">
		<?php echo $form->labelEx($model,'lastpaid'); ?>
		<?php echo $form->textField($model,'lastpaid'); ?>
		<?php echo $form->error($model,'lastpaid'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'requirepo'); ?>
		<?php echo $form->checkBox($model,'requirepo'); ?>
		<?php echo $form->error($model,'requirepo'); ?>
	</div>


		<?php echo $form->hiddenField($model,'post'); ?>
	
    <div class="row">
		<?php echo $form->labelEx($model,'phone1'); ?>
		<?php echo $form->textField($model,'phone1',array('size'=>6,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'phone1'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'fdic'); ?>
		<?php echo $form->textField($model,'fdic',array('size'=>6,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'fdic'); ?>
	</div>

    <div class="row">
            <?php echo $form->labelEx($model,'aba'); ?>
            <?php echo $form->textField($model,'aba',array('size'=>6,'maxlength'=>255)); ?>
            <?php echo $form->error($model,'aba'); ?>
    </div>
    <div class="row">
            <?php echo $form->labelEx($model,'abamember'); ?>
            <?php echo $form->checkBox($model,'abamember'); ?>
            <?php echo $form->error($model,'abamember'); ?>
    </div>

	<?php echo $form->hiddenField($model,'defpriority',array('size'=>6,'maxlength'=>6)); ?>
	

	<div class="row">
		<?php echo $form->labelEx($model,'salesperson'); ?>
		<?php echo $form->dropDownList($model,'salesperson',$model->getSalePersonList()); ?>
		<?php echo $form->error($model,'salesperson'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'customerinactive'); ?>
		<?php echo $form->dropDownList($model,'customerinactive',$model->activeList); ?>
		<?php echo $form->error($model,'customerinactive'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'website'); ?>
		<?php echo $form->textField($model,'website',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo $form->error($model,'website'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'quickbook'); ?>
		<?php echo $form->textField($model,'quickbook',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'quickbook'); ?>
	</div>
	
    <div class="row">
        <?php echo $form->labelEx($model,'achsetup'); ?>
        <?php echo $form->checkBox($model,'achsetup'); ?>
        <?php echo $form->error($model,'achsetup'); ?>
    </div>
     <div class="row">
		<?php echo $form->labelEx($model,'esc_account'); ?>
		<?php echo $form->textField($model,'esc_account',array('size'=>7,'maxlength'=>7)); ?>
		<?php echo $form->error($model,'esc_account'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'emailstatement'); ?>
		<?php echo $form->checkBox($model,'emailstatement'); ?>
		<?php echo $form->error($model,'emailstatement'); ?>
	</div>
   <!--  <div class="row">
        <label>Total Paid</label>
        <div class="model-data">
            <?php //echo $model->getTotalPaidPayment()?>
        </div>            
    </div>
    <div class="row">
        <label>Total Un-Paid</label>
        <div class="model-data">
            <?php //echo $model->getTotalUnpaidPayment()?>
        </div>
    </div>
    <div class="row">
        <label>Un-Invoiced Work</label>
        <div class="model-data">
            <?php //echo $model->getTotalUninvoicedWork()?>
        </div>
    </div> -->
	
	<div class="row">
		<?php echo $form->labelEx($model,'notes'); ?>
		<?php echo $form->textArea($model,'notes',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'notes'); ?>
	</div>
<div class="row">
		<?php echo $form->labelEx($model,'specialnotes'); ?>
		<?php echo $form->textArea($model,'specialnotes',array('size'=>60)); ?>
		<?php echo $form->error($model,'specialnotes'); ?>
	</div>
    
	<div class="row_buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array(
                    'id'=>'btnSubmitForm',
                    'onclick'=>''
                )); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
